<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------------
| URI ROUTING
| -------------------------------------------------------------------------
| This file lets you re-map URI requests to specific controller functions.
|
| Typically there is a one-to-one relationship between a URL string
| and its corresponding controller class/method. The segments in a
| URL normally follow this pattern:
|
|	example.com/class/method/id/
|
| In some instances, however, you may want to remap this relationship
| so that a different class/function is called than the one
| corresponding to the URL.
|
| Please see the user guide for complete details:
|
|	http://codeigniter.com/user_guide/general/routing.html
|
| -------------------------------------------------------------------------
| RESERVED ROUTES
| -------------------------------------------------------------------------
|
| There area two reserved routes:
|
|	$route['default_controller'] = 'welcome';
|
| This route indicates which controller class should be loaded if the
| URI contains no data. In the above example, the "welcome" class
| would be loaded.
|
|	$route['404_override'] = 'errors/page_missing';
|
| This route will tell the Router what URI segments to use if those provided
| in the URL cannot be matched to a valid route.
|
*/
 
$route['default_controller'] = "home/index";
$route['404_override']       = 'error/view404';
$route['trang-chu']          = "home/index";
$route['trang-([0-9]+)']     = "home/index/$1";
$route['trang-chu']          = "home/mainMenu";

$route['truyen-([a-z|0-9|\-]+)']                = "book/listBook/$1";
$route['truyen']                                = "book/searchBook/";
//book page
$route['truyen-([a-z|0-9|\-]+)/trang-([0-9]+)']     = "book/listBook/$1/$2";
$route['truyen-([a-z|0-9|\-]+)/([a-z|0-9|\-]+)']    = "chapter/listChapter/$1/$2";
//chapter page
$route['truyen-([a-z|0-9|\-]+)/([a-z|0-9|\-]+)/trang-([0-9]+)']                      = "chapter/listChapter/$1/$2/$3";
$route['truyen-([a-z|0-9|\-]+)/([a-z|0-9|\-]+)/chuong-([0-9]+)-([a-z|A-Z|0-9|\-]+)'] = "chapter/detailChapter/$1/$2/$3/$4";

$route['thong-tin/([a-z|0-9|\-]+)'] = "info/detailInfo/$1"; 

//router admin
$route['admin'] 			   = "admin/login/index";
$route['logout']               = "admin/login/logout_user";

$route['admin/list-book']                        = "admin/book/listBook";
$route['admin/list-book/trang-([0-9]+)']         = "admin/book/listBook/$1";
$route['admin/add-book']                         = "admin/book/addBook";
$route['admin/update-book/([a-z|A-Z|0-9|\-]+)']  = "admin/book/updateBook/$1";
$route['admin/delete-book/([a-z|A-Z|0-9|\-]+)']  = "admin/book/deleteBook/$1";

$route['admin/list-category']                        = "admin/category/listCategory";
$route['admin/list-category/trang-([0-9]+)']         = "admin/category/listCategory/$1";
$route['admin/add-category']                         = "admin/category/addCategory";
$route['admin/update-category/([a-z|A-Z|0-9|\-]+)']  = "admin/category/updateCategory/$1";
$route['admin/delete-category/([a-z|A-Z|0-9|\-]+)']  = "admin/category/deleteCategory/$1";

$route['admin/list-author']                        = "admin/author/listAuthor";
$route['admin/list-author/trang-([0-9]+)']         = "admin/author/listAuthor/$1";
$route['admin/add-author']                         = "admin/author/addAuthor";
$route['admin/update-author/([a-z|A-Z|0-9|\-]+)']  = "admin/author/updateAuthor/$1";
$route['admin/delete-author/([a-z|A-Z|0-9|\-]+)']  = "admin/author/deleteAuthor/$1";

$route['admin/list-image']                        = "admin/image/listImage";
$route['admin/list-image/trang-([0-9]+)']         = "admin/image/listImage/$1";
$route['admin/add-image']                         = "admin/image/addImage";
$route['admin/update-image/([a-z|A-Z|0-9|\-]+)']  = "admin/image/updateImage/$1";
$route['admin/delete-image/([a-z|A-Z|0-9|\-]+)']  = "admin/image/deleteImage/$1";

$route['admin/list-volume']                        = "admin/volume/listVolume";
$route['admin/list-volume/trang-([0-9]+)']         = "admin/volume/listVolume/$1";
$route['admin/add-volume']                         = "admin/volume/addVolume";
$route['admin/update-volume/([a-z|A-Z|0-9|\-]+)']  = "admin/volume/updateVolume/$1";
$route['admin/delete-volume/([a-z|A-Z|0-9|\-]+)']  = "admin/volume/deleteVolume/$1";

$route['admin/list-chapter']                                        = "admin/chapter/listChapter";
$route['admin/list-chapter/trang-([0-9]+)']                         = "admin/chapter/listChapter/$1";
$route['admin/list-chapter/([a-z|A-Z|0-9|\-]+)/trang-([0-9]+)']     = "admin/chapter/listChapter/$1/$2";
$route['admin/add-chapter']                                         = "admin/chapter/addChapter";
$route['admin/update-chapter/chuong-([0-9]+)-([a-z|A-Z|0-9|\-]+)']  = "admin/chapter/updateChapter/$1/$2";
$route['admin/delete-chapter/chuong-([0-9]+)-([a-z|A-Z|0-9|\-]+)']  = "admin/chapter/deleteChapter/$1/$2";

$route['admin/list-promotion']                        = "admin/promotion/listPromotion";
$route['admin/add-promotion']                         = "admin/promotion/addPromotion";
$route['admin/delete-promotion/([a-z|A-Z|0-9|\-]+)']  = "admin/promotion/deletePromotion/$1";

$route['admin/list-chapter-error']                        = "admin/chapter/listChapterError";
$route['admin/delete-chapter-error/([a-z|A-Z|0-9|\-]+)']  = "admin/chapter/deleteChapterError/$1";

//$route['admin/list-chapter-by-book']                   = "admin/chapter/listChapterByBookID";
//$route['admin/list-chapter-by-book/([a-z|A-Z|0-9|\-]+)/trang-([0-9]+)']    = "admin/chapter/listChapterByBookID/$1/$2";

$route['admin/import-chapter']                                        = "admin/excel/importExcel";
$route['admin/export-chapter']                                        = "admin/excel/exportExcel";

/* End of file routes.php */
/* Location: ./application/config/routes.php */